#ifndef  __COMBAT_DATA_HH__
#define  __COMBAT_DATA_HH__

#include "Gene/GeneIf.h"
#include "CombatCalculatorIf.h"


class CombatSkill;
//
//	Props for entities
//
enum
{
	prop_vit,
	prop_str,
	prop_agi,
	prop_int,
	prop_left,
	prop_tohit,
	prop_tododge,
	prop_critical,
	prop_resist,
	prop_ap,
	prop_dp,
	prop_max,
};

//
//	Combat System
//	Any entity can has its owner combat system interface.
//
//	Combat system is a resident gene that can be access from outside by its owner interface.
//
class TCOM_API ICombatSys : public IGene
{
public:
	virtual ~ICombatSys(){}
	
	//
	//	Entity Combat Flags : pay attention to all combat flag index
	virtual	void setFlg(const short& idx)	= 0;
	virtual	void clrFlg(const short& idx)	= 0;
	virtual	bool hasFlg(const short& idx)const	= 0;

	//
	//	Entity Combat State
	//
	virtual	void		setState(short)	= 0;
	virtual	short		getState()const	= 0;
	virtual	const char*	getStateName()const	= 0;
	virtual	const char* getStateName(short st)const	= 0;

	//
	//	Entity Factions
	virtual	void		setFaction(short f)	= 0;
	virtual	short		getFaction()const	= 0;
	virtual	const char*	getFactionName()const	= 0;

	//
	//	
	//
	virtual	void		setHP(int val)	= 0;
	virtual	void		setMaxHP(int val)	= 0;
	virtual	void		setMP(int val)	= 0;
	virtual void		setMaxMP(int val) = 0;
	virtual	int			getHP()const	= 0;
	virtual	int			getMaxHP()const	= 0;
	virtual	int			getMP()const	= 0;
	virtual int			getMaxMP()const = 0;
	virtual	int			getHPPercentage()const	= 0;
	virtual	int			getMPPercentage()const	= 0;

	virtual	int			getBottleHP()const	= 0;
	virtual	int			getBottleMP()const	= 0;
	virtual	int			getHpBottleNum() const	= 0;
	virtual	int			getMpBottleNum() const	= 0;

	//
	//	Entity HP and MP
	//
	virtual	void	updateHPByPercentage(int nPercent)	= 0;
	virtual	void	updateHP(int nAffectValue)	= 0;
	virtual	void	updateMP(int nAffectValue)	= 0;
	virtual	void	updateMaxHP(int nAffectValue)	= 0;
	virtual	void	updateHPBottleValue(int nAffectValue)	= 0;
	virtual	void	updateMPBottleValue(int nAffectValue)	= 0;

	//
	//	Entity Immunity
	virtual	bool	addImmunity(int nKey)	= 0;
	virtual	bool	rmvImmunity(int nKey)	= 0;
	virtual	bool	hasImmunity(int nKey)const	= 0;

	//
	//	Entity base props
	//	vit, str, agi, int, 
	//	tohit, tododge,  
	//	critical, resist
	//	ap, dp
	//
	virtual void	setProps(short nIdx, const int& nValue = 0) = 0;
	virtual int		getProps(short nIdx) const  = 0;
	virtual void	setPropsModifier(short nIdx, const int& nValue = 0) = 0;
	virtual int		getPropsModifier(short nIdx) const  = 0;

	//
	//	Entity Extension Data for combat
	//	For setExtData nValue is the value to set
	//	For getExtData nValue is the default value , when failed to get specific data
	//
	virtual void	setExtData(short nIdx, const int& nValue = 0) = 0;
	virtual int		getExtData(short nIdx, const int& nValue = 0) = 0;
#ifdef _DEBUG
	//	Debug Helper
	virtual const char* getCombatTag()const = 0;
#endif
};

#endif
